             package com.java.diagnostics.visualizer.recommender.pause;
             
             import com.java.diagnostics.visualizer.data.AggregateData;
             import com.java.diagnostics.visualizer.data.DataPoint;
             import com.java.diagnostics.visualizer.data.TupleData;
             import com.java.diagnostics.visualizer.data.axes.Axis;
             import com.java.diagnostics.visualizer.data.axes.XDataAxis;
             import com.java.diagnostics.visualizer.parser.vgc.constants.VGCAxes;
             import com.java.diagnostics.visualizer.recommender.Recommendation;
             import com.java.diagnostics.visualizer.recommender.RecommendationBase;
             import com.java.diagnostics.visualizer.recommender.util.RecommendationLabels;
             import java.text.MessageFormat;
             
             public class CalculateMeanOverhead
               extends RecommendationBase
               implements Recommendation
             {
               public void recommend(AggregateData data)
               {
                 TupleData pauseTimeData = data
                   .getTupleData("VGCLabels.pause.times.with.exclusive.access");
                 
                 if ((pauseTimeData == null) || (pauseTimeData.isEmpty())) {
                   pauseTimeData = 
                     data.getTupleData("VGCLabels.pause.times.without.exclusive.access");
                 }
                 
                 if ((pauseTimeData != null) && 
                   (!pauseTimeData.isEmpty()) && 
                   (!VGCAxes.NUMBER.equals(
                   pauseTimeData.getXAxis().getAxis().getBaseUnitName())))
                 {
                   double endTime = pauseTimeData.getRawMaxX();
                   double startTime = pauseTimeData.getRawMinX();
                   double elapsedTime = endTime - startTime;
                   
                   if (elapsedTime < 1000.0D) {
                     return;
                   }
                   
                   double totalPause = pauseTimeData.getRawTotalY();
                   double finalPause = pauseTimeData.getLastDataPoint().getRawY();
                   
                   double totalElapsedTime = finalPause + elapsedTime;
                   
                   double overhead = totalPause / totalElapsedTime * 
                     100.0D;
                   
                   double dutyCycle = Math.round(overhead * 100.0D) / 100.0D;
                   double worktime = 100.0D - dutyCycle;
                   
                   addToSummary(
                     data, 
                     RecommendationLabels.PROPORTION_OF_TIME_SPENT_IN_GARBAGE_COLLECTION_PAUSES, 
                     new Float(dutyCycle));
                   addToSummary(data, 
                     RecommendationLabels.PROPORTION_OF_TIME_SPENT_UNPAUSED, 
                     new Float(worktime));
                   
                   Object gcMode = getGCMode(data);
                   if ((dutyCycle >= 2.0D) && ("gencon".equals(gcMode))) {
                     String string = 
                       MessageFormat.format(RecommendationLabels.HIGH_OVERHEAD_MESSAGE, new Object[] { Double.valueOf(dutyCycle) }) + RecommendationLabels.INCREASE_HEAP;
                     addWarning(data, string);
                   } else if ((dutyCycle >= 10.0D) && (
                     ("optthruput".equals(gcMode)) || 
                     ("optavgpause".equals(gcMode)))) {
                     String string = 
                       MessageFormat.format(RecommendationLabels.HIGH_OVERHEAD_MESSAGE, new Object[] { Double.valueOf(dutyCycle) }) + RecommendationLabels.INCREASE_HEAP;
                     addWarning(data, string);
                   }
                 }
               }
             }


